home *** CD-ROM | disk | FTP | other *** search
/ Champak 26 (Anniversary Edition) / Volume 26 [Anniversary Edition] - JOGO DISK .iso / Fight / armadilloknight.swf / scripts / DefineSprite_298 / frame_1 / PlaceObject2_252_355 / CLIPACTIONRECORD onClipEvent(load).as < prev   
Text File  |  2006-05-08  |  1KB  |  63 lines

  1. onClipEvent(load){
  2.    function vReset()
  3.    {
  4.       attackPwr = 12;
  5.       hp = 20;
  6.       vVelocity = 0;
  7.       gravity = 4;
  8.       tVelocity = 30;
  9.       grounded = false;
  10.       hVelocity = 0;
  11.       maxSpeed = 9;
  12.       this._x = startX;
  13.       this._y = starty;
  14.       stunned = false;
  15.       speed = 8;
  16.       jumpTimer = 0;
  17.       jumpDelay = 20;
  18.       goJump = false;
  19.       dead = false;
  20.    }
  21.    function die()
  22.    {
  23.       _parent.deathEffect._x = this._x;
  24.       _parent.deathEffect._y = this._y;
  25.       _parent.deathEffect.gotoAndPlay(2);
  26.       _parent.deathEffect.s.start();
  27.       this._y = _root.world.safeY;
  28.       _parent.spang._y = _root.world.safeY;
  29.       _parent.player.score += 200;
  30.       dead = true;
  31.    }
  32.    function getHit(damage, xoff)
  33.    {
  34.       hp -= damage;
  35.       stunned = true;
  36.       if(0 >= hp)
  37.       {
  38.          hp = 0;
  39.          die();
  40.       }
  41.       if(xoff < this._x)
  42.       {
  43.          this.vVelocity = -10;
  44.          this.hVelocity = 14;
  45.          grounded = false;
  46.       }
  47.       else
  48.       {
  49.          this.vVelocity = -10;
  50.          this.hVelocity = -14;
  51.          grounded = false;
  52.       }
  53.    }
  54.    r = new Sound(this);
  55.    r.attachSound("raieetFast");
  56.    slash = new Sound(this);
  57.    slash.attachSound("slash2");
  58.    startX = this._x;
  59.    startY = this._y;
  60.    attackTarget = _parent.player._x;
  61.    vReset();
  62. }
  63.